package com.ss.android.article.base.feature.feed;

import android.content.Context;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import com.bytedance.common.utility.UIUtils;
import com.ss.android.article.base.feature.feed.activity.ArticleListFragment;
import com.ss.android.article.base.feature.feed.activity.DislikeDialog;
import com.ss.android.article.base.feature.feed.activity.ai;
import com.ss.android.article.browser.R;

public interface dd {
    public final class a {
        public final ArticleListFragment a;

        public a(ArticleListFragment arg1) {
            this.a = arg1;
        }
    }

    final class WindowFocusChangeListener {
        private final ArticleListFragment a;

        public WindowFocusChangeListener(ArticleListFragment arg1) {
            this.a = arg1;

        }

        public final void a(Object arg14) {
            int v5;
            View v12 = null;
            int v11 = 2;
            if(this.a.dislikeDialogManager != null && ((arg14 instanceof DislikeDialog))) {
                FragmentActivity v1 = this.a.getActivity();
                Object v0 = arg14;
                View v3 = this.a.mClickedPopIcon;
                if(v0 != null && v3 != null && v1 != null) {
                    ((DislikeDialog)v0).a();
                    int[] v4 = new int[v11];
                    v3.getLocationOnScreen(v4);
                    int v2 = UIUtils.getScreenWidth(((Context)v1));
                    v5 = UIUtils.getScreenHeight(((Context)v1));
                    int v6 = UIUtils.getStatusBarHeight(((Context)v1));
                    int v1_1 = com.ss.android.article.base.feature.app.a.b.e;
                    if(v3.getId() == R.id.ay) {
                        v1_1 = v2 - v3.getRight() + v3.getPaddingRight() - com.ss.android.article.base.feature.app.a.b.e + com.ss.android.article.base.feature.app.a.b.d;
                    }

                    v5 = v5 - v4[1] - v3.getHeight() - com.ss.android.article.base.feature.app.a.b.a;
                    v2 = ((DislikeDialog)v0).b();
                    if(((DislikeDialog)v0).c()) {
                        v2 += v2 / 4;
                    }

                    if(v5 > v2) {
                        ((DislikeDialog)v0).a(true);
                        v2 = v4[1] - v6 + v3.getHeight() - v3.getPaddingBottom() + com.ss.android.article.base.feature.app.a.b.a;
                        ((DislikeDialog)v0).a(v1_1);
                        v1_1 = v2;
                    }
                    else {
                        ((DislikeDialog)v0).a(false);
                        v2 = v4[1] - v2 - v6 + v3.getPaddingTop() - com.ss.android.article.base.feature.app.a.b.a;
                        ((DislikeDialog)v0).b(v1_1);
                        v1_1 = v2;
                    }

                    ((DislikeDialog)v0).d();
                    ((DislikeDialog)v0).c(v1_1);
                }

                this.a.mClickedPopIcon = v12;
            }

            if(this.a.mFeedActionDialogManager != null && ((arg14 instanceof ai))) {
                FragmentActivity v0_1 = this.a.getActivity();
                View v1_2 = this.a.mClickedPopIcon;
                if(arg14 != null && v1_2 != null && v0_1 != null) {
                    ((ai)arg14).a();
                    int[] v2_1 = new int[v11];
                    v1_2.getLocationOnScreen(v2_1);
                    int v3_1 = UIUtils.getScreenHeight(((Context)v0_1));
                    int v4_1 = UIUtils.getStatusBarHeight(((Context)v0_1));
                    v5 = (v3_1 - v4_1) / 2;
                    v3_1 = v1_2.getPaddingBottom() + (v3_1 - v2_1[1] - v1_2.getHeight());
                    int v0_2 = ((ai)arg14).b();
                    if(((ai)arg14).c()) {
                        v0_2 = ((ai)arg14).d();
                    }

                    if(v3_1 > v5) {
                        ((ai)arg14).a(true);
                        v0_2 = v2_1[1] - v4_1 + v1_2.getHeight() - v1_2.getPaddingBottom() + com.ss.android.article.base.feature.app.a.b.c;
                    }
                    else {
                        ((ai)arg14).a(false);
                        v0_2 = v2_1[1] - v0_2 - v4_1 + v1_2.getPaddingTop() - com.ss.android.article.base.feature.app.a.b.b;
                    }

                    ((ai)arg14).e();
                    ((ai)arg14).a(v0_2);
                }

                this.a.mClickedPopIcon = v12;
            }
        }
    }

    void a();

    void a(int arg1);

    void a(boolean arg1);

    int b();

    void b(int arg1);

    void c(int arg1);

    boolean c();

    void d();
}

